<!--
 * @FilePath     : /study_code/css/box-sizing_border-box.html
 * @Description  : border-box
 * @Date         : 2025-04-27 16:07:31
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-27 16:09:14
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      .box {
        width: 100px;
        height: 40px;
        margin: 7px;
        border: 8px solid rgba(168, 65, 65, 0.7);
        padding: 9px;
        background-color: rgba(49, 108, 197, 0.8);
        box-sizing: border-box;
      }
      /*
      分析：
      调试工具元素显示尺寸： 100 * 40 （为 w & h 定义的尺寸）
      元素占地尺寸：
      7 * 2 + 100
      7 * 2 + 40
      */
    </style>
  </head>
  <body>
    <div class="box">文本</div>

    <script>
      console.log(document.querySelector('.box').clientHeight) // 24
    </script>
  </body>
</html>
